package Java多线程技术.问题;

public class MyService {

    public void test(){
        try {
            synchronized (MyService.class){
                System.out.println("wait begin "+Thread.currentThread().getName()+" "+System.currentTimeMillis());
//                wait(5000);
                Thread.sleep(1000);

                System.out.println("wait end "+Thread.currentThread().getName()+" "+System.currentTimeMillis());
            }
        }catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

//    public synchronized void longTest(){
//        try {
//            Thread.sleep(8000);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
//    }
}
